@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 210 100% 50%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 210 100% 50%;
    --radius: 0.5rem;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 210 100% 50%;
    --primary-foreground: 222.2 47.4% 11.2%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 210 100% 50%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground;
  }
}

@layer utilities {
  .bg-grid-slate-200 {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='rgb(226 232 240 / 0.8)'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e");
  }

  .bg-grid-slate-800 {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='rgb(30 41 59 / 0.8)'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e");
  }
}

/* Ant Design Button Icon with Lucide icons */
.ant-btn-icon {
  display: inline-flex !important;
  align-items: center !important;
}

.ant-collapse-header {
  @apply bg-gray-50;
}

.ant-collapse-collapsible-disabled {
  cursor: default !important;
}

.ant-collapse-content-box {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-right: 0 !important;
}

.ant-collapse-item-active>.ant-collapse-header {
  @apply shadow-md;
}
.ant-collapse-item-disabled>.ant-collapse-header {
  @apply cursor-default;
}

/* Styles for the List component inside MemoryManageModal */
.memory-modal-list .ant-list-item {
  display: flex;
  align-items: flex-start;
  margin-top: 2px;
}

.memory-modal-list .ant-list-item-action {
  width: 5%;
  margin-left: auto !important;
  display: flex;
  justify-content: right;
}

.memory-modal-panel {
  background: #f9fafb;
  border-radius: 4px;
  border: 1px solid #f0f0f0;
}

/* Scrollbar styles */
/* For Webkit browsers (Chrome, Safari, Edge, etc.) */
::-webkit-scrollbar {
  width: 16px;
  background-color: transparent;
}

::-webkit-scrollbar-track {
  background-color: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* For Firefox */
* {
  scrollbar-color: rgba(0, 0, 0, 0.4) transparent;
}

/* Tool Pool Tabs scroll fix */
.tool-pool-tabs .ant-tabs-content-holder {
  overflow: hidden;
  height: 100%;
}

.tool-pool-tabs .ant-tabs-content {
  height: 100%;
}

.tool-pool-tabs .ant-tabs-tabpane {
  height: 100%;
  overflow: hidden;
}

/* Ensure tool pool tabs content area can scroll */
.tool-pool-tabs .ant-tabs-content-holder .ant-tabs-content .ant-tabs-tabpane > div {
  height: 100%;
  max-height: 100%;
}

/* Adjust tabs content area left and right padding - use stronger selector */
.tool-pool-tabs.ant-tabs.ant-tabs-left > .ant-tabs-content-holder {
  padding-left: 12px !important;
  padding-right: 9px !important;
  margin-left: 0 !important;
}

.tool-pool-tabs.ant-tabs.ant-tabs-left > .ant-tabs-content-holder > .ant-tabs-content {
  padding-left: 0 !important;
  margin-left: 0 !important;
}

.tool-pool-tabs.ant-tabs.ant-tabs-left .ant-tabs-tabpane {
  padding-left: 0 !important;
}

/* Reduce tab inner and outer margins to make tabs more compact */
.tool-pool-tabs .ant-tabs-tab {
  padding: 12px 6px !important;
  margin: 4px 2px !important;
  min-height: auto !important;
  width: auto !important;
  max-width: 100px !important;
}

.tool-pool-tabs .ant-tabs-nav-list {
  padding: 4px 0 !important;
  width: auto !important;
}

.tool-pool-tabs .ant-tabs-tab-btn {
  padding: 0 !important;
  line-height: 1.2 !important;
}

/* Styles for Embedding warning modal */
.kb-embedding-warning .ant-modal-wrap {
  position: absolute;
  inset: 0;
}

.kb-embedding-warning .ant-modal {
  width: max-content;
  min-width: 0;
}